/**
 * 
 */
package com.manage.action;

import java.util.List;

import org.apache.log4j.Logger;


import com.action.AbstractAction;
import com.manage.cache.ThreePayParamaterManager;
import com.manage.cache.ThreePayProvidersManager;
import com.manage.model.ThreePayParamater;
import com.manage.model.ThreePayProviders;


public class ThreePayParamaterAction extends AbstractAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private Logger logger;
	
	public ThreePayParamaterAction()
	{
		logger = Logger.getLogger(this.getClass());
	}
	
	public String execute()
	{
		return SUCCESS;
	}

	private List<ThreePayParamater> list;
	private ThreePayParamater       model;
	private String        type;
	private ThreePayProviders threepayinfo;
	
	public String list()
	{
		logger.debug("list ThreePayParamaterAction");
		threepayinfo = ThreePayProvidersManager.getInstance().getThreePayProviders(model.getThreepayid());
		list =  ThreePayParamaterManager.getInstance().getThreePayParamaterByThreePayId(model.getThreepayid());
		return SUCCESS;
	}
	
	public String show()
	{
		threepayinfo = ThreePayProvidersManager.getInstance().getThreePayProviders(model.getThreepayid());
		if (model.getId() >= 0)
		{
			model = ThreePayParamaterManager.getInstance().getThreePayParamater(model.getId());
			type = "update";
		}
		else
		{
			model.setId(-1);
			type = "insert";
		}

		return SUCCESS;
	}
	 
	public String save()
	{
		ThreePayParamaterManager.getInstance().saveThreePayParamater(operator, type, model);
		return SUCCESS;
	}

	public List<ThreePayParamater> getList() {
		return list;
	}

	public void setList(List<ThreePayParamater> list) {
		this.list = list;
	}

	public ThreePayParamater getModel() {
		return model;
	}

	public void setModel(ThreePayParamater model) {
		this.model = model;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public ThreePayProviders getThreepayinfo() {
		return threepayinfo;
	}

	public void setThreepayinfo(ThreePayProviders threepayinfo) {
		this.threepayinfo = threepayinfo;
	}
	
}
